$OpenBSD: patch-Makefile_am,v 1.4 2011/06/07 00:13:08 sthen Exp $
--- Makefile.am.orig	Thu Sep 22 11:39:18 2005
+++ Makefile.am	Mon Jun  6 18:43:32 2011
@@ -1,13 +1,13 @@
-CC=gcc
-LIB=-lpcre -L./pcre-3.9/ -I./pcre-3.9/
+CC?=gcc
+LIB=-lpcre -L$(LOCALBASE)/lib
 OPT=-O2
 OPT_DEBUG=-ggdb -Wall -lefence
 BINDIR=/bin
-DATADIR=/etc
+DATADIR=/share/amap
 MANDIR=/man/man1
 SCRIPTS=appdefs.trig appdefs.resp appdefs.rpc
 MANPAGE=amap.1
-all:	pcre strip
+all:	amap amapcrap
 
 pcre:
 	cd pcre-3.9 && make
@@ -35,14 +35,11 @@ debug:	amap.c
 
 install:	all
 	@echo Installing to $(PREFIX), change this by running ./configure --prefix=path
-	-mkdir -vp $(PREFIX)$(BINDIR) 2> /dev/null
-	-mkdir -vp $(PREFIX)$(DATADIR) 2> /dev/null
-	-mkdir -vp $(PREFIX)$(MANDIR) 2> /dev/null
-	-test -e amap.exe || cp -f amap amap6 amapcrap $(PREFIX)$(BINDIR)
-	-test -e amap.exe && cp -f amap.exe amapcrap.exe $(PREFIX)$(BINDIR) || echo
-	-cp -f $(SCRIPTS) $(PREFIX)$(DATADIR)
-	-cp -f $(MANPAGE) $(PREFIX)$(MANDIR)
-	-test $(PREFIX)$(BINDIR)/amap6 || cd $(PREFIX)$(BINDIR) && ln -s amap amap6
+	@test -e amap && $(BSD_INSTALL_PROGRAM) amap amap6 amapcrap $(DESTDIR)$(PREFIX)$(BINDIR)
+	@test -d $(DESTDIR)$(PREFIX)$(MANDIR) || mkdir -p $(DESTDIR)$(PREFIX)$(MANDIR)
+	$(BSD_INSTALL_MAN) $(MANPAGE) $(DESTDIR)$(PREFIX)$(MANDIR)
+	@test -d $(DESTDIR)$(PREFIX)$(DATADIR) || mkdir -p $(DESTDIR)$(PREFIX)$(DATADIR)
+	$(BSD_INSTALL_SCRIPT) $(SCRIPTS) $(DESTDIR)$(PREFIX)$(DATADIR)
 
 clean:	
 	cd pcre-3.9 && make clean
